#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <malloc.h>
#define MAXSIZE 100
typedef int Type;
typedef struct {
	Type data[MAXSIZE];
	int top;
}SeqStack;

SeqStack* InitStack()
{
	SeqStack* s = (SeqStack*)malloc(sizeof(SeqStack));
	s->top = -1;
	return s;
}

int push(SeqStack* s, Type x)
{
	if (s->top == MAXSIZE - 1)
	{
		return 0;
	}
	s->top++;
	s->data[s->top] = x;
	return 1;
}

int pop(SeqStack* s, Type* x)
{
	if (s->top == -1)
		return 0;
	*x = s->data[s->top];
	s->top--;
	return 1;
}


int GetTop(SeqStack* s, Type* x)
{
	if (s->top == -1)
		return 0;
	*x = s->data[s->top];
	return 1;
}

void Dec(int d, int r)
{
	SeqStack* s = InitStack();
	Type x;
	while (d > 0)
	{
		push(s, d % r);
		d = d / r;
	}

	while (s->top != -1)
	{
		pop(s, &x);
		printf("%d", x);
	}
}

int Match(char* str)
{
	int i = 0;
	Type x;
	SeqStack* s = InitStack();
	while (str[i] != '\0')
	{
		if (str[i] == '(' || str[i] == '[' || str[i] == '{')
		{
			push(s, str[i]);
		}
		else if (str[i] == ')' || str[i] == ']' || str[i] == '}')
		{
			if (s->top == -1)
				return 0;
			pop(s, &x);
			if (x == '(' && str[i] == ')' || x == '[' && str[i] == ']' || x == '{' && str[i] == '}')
			{
				return 1;
			}
			else return 0;
		}
		i++;
	}
	if (s->top == -1)
		return 1;
	else
		return 0;
}


int main()
{
	/*int d, r;
	scanf("%d%d", &d, &r);
	Dec(d, r);*/

	char ch[100];
	gets(ch);
	if (Match(ch) == 1)
		printf("yes");
	if (Match(ch) == 0)
		printf("no");
	return 0;
}